package com.adee.java.json;

import com.alibaba.fastjson.JSON;

/**
 * fastjson在对象转String时可能有类型转换问题，推荐使用gson
 */
public class Test001_FastJson {
    public static void main(String[] args) {
        testFastJson();
    }


    public static void testFastJson() {
        User user = new User(true);
        String s = JSON.toJSONString(user);
        System.out.println(s);
        User user1 = JSON.parseObject(s, User.class);
        System.out.println(user1.toString());
    }
}


